
class IseResultEntity {
  XmlResult xmlResult;

  IseResultEntity({this.xmlResult});

  IseResultEntity.fromJson(Map<String, dynamic> json) {
    xmlResult = json['xml_result'] != null
        ? new XmlResult.fromJson(json['xml_result'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.xmlResult != null) {
      data['xml_result'] = this.xmlResult.toJson();
    }
    return data;
  }
}

class XmlResult {
  ReadSentence readSentence;

  XmlResult({this.readSentence});

  XmlResult.fromJson(Map<String, dynamic> json) {
    readSentence = json['read_sentence'] != null
        ? new ReadSentence.fromJson(json['read_sentence'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.readSentence != null) {
      data['read_sentence'] = this.readSentence.toJson();
    }
    return data;
  }
}

class ReadSentence {
  String lan;
  String type;
  String version;
  RecPaper recPaper;

  ReadSentence({this.lan, this.type, this.version, this.recPaper});

  ReadSentence.fromJson(Map<String, dynamic> json) {
    lan = json['lan'];
    type = json['type'];
    version = json['version'];
    recPaper = json['rec_paper'] != null
        ? new RecPaper.fromJson(json['rec_paper'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['lan'] = this.lan;
    data['type'] = this.type;
    data['version'] = this.version;
    if (this.recPaper != null) {
      data['rec_paper'] = this.recPaper.toJson();
    }
    return data;
  }
}
class RecPaper {
  RecPaperReadSentence readSentence;

  RecPaper({this.readSentence});

  RecPaper.fromJson(Map<String, dynamic> json) {
    readSentence =
    json['read_sentence'] != null
        ?
        //中文
    new RecPaperReadSentence.fromJson(json['read_sentence'])
        :
        //英文
    (json['read_chapter'] != null
        ? new RecPaperReadSentence.fromJson(json['read_chapter'])
        : null);
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.readSentence != null) {
      data['read_sentence'] = this.readSentence.toJson();
    }
    return data;
  }
}

class RecPaperReadSentence {
  String accuracyScore;
  String begPos;
  String content;
  String emotionScore;
  String endPos;
  String exceptInfo;
  String fluencyScore;
  String integrityScore;
  String isRejected;
  String phoneScore;
  String timeLen;
  String toneScore;
  String totalScore;
  Sentence sentence;

  RecPaperReadSentence(
      {this.accuracyScore,
        this.begPos,
        this.content,
        this.emotionScore,
        this.endPos,
        this.exceptInfo,
        this.fluencyScore,
        this.integrityScore,
        this.isRejected,
        this.phoneScore,
        this.timeLen,
        this.toneScore,
        this.totalScore,
        this.sentence});

  RecPaperReadSentence.fromJson(Map<String, dynamic> json) {
    accuracyScore = json['accuracy_score'];
    begPos = json['beg_pos'];
    content = json['content'];
    emotionScore = json['emotion_score'];
    endPos = json['end_pos'];
    exceptInfo = json['except_info'];
    fluencyScore = json['fluency_score'];
    integrityScore = json['integrity_score'];
    isRejected = json['is_rejected'];
    phoneScore = json['phone_score'];
    timeLen = json['time_len'];
    toneScore = json['tone_score'];
    totalScore = json['total_score'];
    sentence = json['sentence'] != null
        ? new Sentence.fromJson(json['sentence'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['accuracy_score'] = this.accuracyScore;
    data['beg_pos'] = this.begPos;
    data['content'] = this.content;
    data['emotion_score'] = this.emotionScore;
    data['end_pos'] = this.endPos;
    data['except_info'] = this.exceptInfo;
    data['fluency_score'] = this.fluencyScore;
    data['integrity_score'] = this.integrityScore;
    data['is_rejected'] = this.isRejected;
    data['phone_score'] = this.phoneScore;
    data['time_len'] = this.timeLen;
    data['tone_score'] = this.toneScore;
    data['total_score'] = this.totalScore;
    if (this.sentence != null) {
      data['sentence'] = this.sentence.toJson();
    }
    return data;
  }
}

class Sentence {
  String begPos;
  String content;
  String endPos;
  String fluencyScore;
  String phoneScore;
  String timeLen;
  String toneScore;
  String totalScore;
  List<Word> word;

  Sentence(
      {this.begPos,
        this.content,
        this.endPos,
        this.fluencyScore,
        this.phoneScore,
        this.timeLen,
        this.toneScore,
        this.totalScore,
        this.word});

  Sentence.fromJson(Map<String, dynamic> json) {
    begPos = json['beg_pos'];
    content = json['content'];
    endPos = json['end_pos'];
    fluencyScore = json['fluency_score'];
    phoneScore = json['phone_score'];
    timeLen = json['time_len'];
    toneScore = json['tone_score'];
    totalScore = json['total_score'];
    if (json['word'] != null) {
      word = new List<Word>();
      json['word'].forEach((v) {
        word.add(new Word.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['beg_pos'] = this.begPos;
    data['content'] = this.content;
    data['end_pos'] = this.endPos;
    data['fluency_score'] = this.fluencyScore;
    data['phone_score'] = this.phoneScore;
    data['time_len'] = this.timeLen;
    data['tone_score'] = this.toneScore;
    data['total_score'] = this.totalScore;
    if (this.word != null) {
      data['word'] = this.word.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Word {
  String begPos;
  String content;
  String endPos;
  String symbol;
  String timeLen;
  dynamic syll;

  Word(
      {this.begPos,
        this.content,
        this.endPos,
        this.symbol,
        this.timeLen,
        this.syll});

  Word.fromJson(Map<String, dynamic> json) {
    begPos = json['beg_pos'];
    content = json['content'];
    endPos = json['end_pos'];
    symbol = json['symbol'];
    timeLen = json['time_len'];
    if (json['syll'] != null) {
      if(json['syll'] is List){
        syll = new List<Syll>();
        json['syll'].forEach((v) {
          syll.add(new Syll.fromJson(v));
        });
      }else{
        syll=json['syll'] != null
            ? new Syll.fromJson(json['syll'])
            : null;
      }
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['beg_pos'] = this.begPos;
    data['content'] = this.content;
    data['end_pos'] = this.endPos;
    data['symbol'] = this.symbol;
    data['time_len'] = this.timeLen;
    if (this.syll != null) {
      if(this.syll is List){
        data['syll'] = this.syll.map((v) => v.toJson()).toList();
      }else{
        data['syll'] = this.syll.toJson();
      }
    }
    return data;
  }
}

class Syll {
  String begPos;
  String content;
  String dpMessage;
  String endPos;
  String recNodeType;
  String timeLen;
  dynamic phone;
  String symbol;

  Syll(
      {this.begPos,
        this.content,
        this.dpMessage,
        this.endPos,
        this.recNodeType,
        this.timeLen,
        this.phone,
        this.symbol});

  Syll.fromJson(Map<String, dynamic> json) {
    begPos = json['beg_pos'];
    content = json['content'];
    dpMessage = json['dp_message'];
    endPos = json['end_pos'];
    recNodeType = json['rec_node_type'];
    timeLen = json['time_len'];
    if (json['phone'] != null) {
      if(json['phone'] is List){
        phone = new List<Phone>();
        json['phone'].forEach((v) {
          phone.add(new Phone.fromJson(v));
        });
      }else{
        phone=json['phone'] != null
            ? new Phone.fromJson(json['phone'])
            : null;
      }
    }
    symbol = json['symbol'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['beg_pos'] = this.begPos;
    data['content'] = this.content;
    data['dp_message'] = this.dpMessage;
    data['end_pos'] = this.endPos;
    data['rec_node_type'] = this.recNodeType;
    data['time_len'] = this.timeLen;
    if (this.phone != null) {
      if(this.phone is List){
        data['phone'] = this.phone.map((v) => v.toJson()).toList();
      }else{
        data['phone'] = this.phone.toJson();
      }
    }
    data['symbol'] = this.symbol;
    return data;
  }
}

class Phone {
  String begPos;
  String content;
  String dpMessage;
  String endPos;
  String recNodeType;
  String timeLen;

  Phone(
      {this.begPos,
        this.content,
        this.dpMessage,
        this.endPos,
        this.recNodeType,
        this.timeLen});

  Phone.fromJson(Map<String, dynamic> json) {
    begPos = json['beg_pos'];
    content = json['content'];
    dpMessage = json['dp_message'];
    endPos = json['end_pos'];
    recNodeType = json['rec_node_type'];
    timeLen = json['time_len'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['beg_pos'] = this.begPos;
    data['content'] = this.content;
    data['dp_message'] = this.dpMessage;
    data['end_pos'] = this.endPos;
    data['rec_node_type'] = this.recNodeType;
    data['time_len'] = this.timeLen;
    return data;
  }
}
